﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using CC98.Metro.Data;

namespace CC98.Metro.Controls
{
    public sealed partial class UserAccountPortrait : UserControl
    {
        public UserAccountPortrait()
        {
            this.InitializeComponent();
            var curSession = UserSessionManager.Instance.Current;
            if(curSession != null)
                this.DataContext = new AccountDataItem() { User = curSession.User, IsLoggedIn = curSession.Client.IsLoggedIn };
        }

        private void btnAccount_Click(object sender, RoutedEventArgs e)
        {
            CommandHandler.NavigateTo(typeof(Pages.Account.AccountList), null);
        }
    }
}
